package model;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

public class GameBoard {
	private Integer playerTurn = 0;

	private Set<Player> players = new HashSet<Player>();

	public void changeTurn() {
		if (playerTurn == 0)
			playerTurn = 1;
		else
			playerTurn = 0;
	}

	public void setPlayerTurn(Integer playerTurn) {
		this.playerTurn = playerTurn;
	}

	public Integer getPlayerTurn() {
		return playerTurn;
	}

	public Set<Player> getPlayers() {
		return Collections.unmodifiableSet(players);
	}

	public void addPlayer(Player player) {
		players.add(player);
		player.setGameBoard(this);
	}
	
	public void removePlayer(Player player) {
		players.remove(player);
		player.setGameBoard(null);
	}

}
